﻿using Prism.Commands;
using Prism.Regions;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PrismRegion.NewRegion.ViewModels
{
    public class DialogViewModel : IDialogAware
    {
        public DelegateCommand ShowSubViewCommand {  get; set; }

        public string Title => "DialogViewModel";

        public event Action<IDialogResult> RequestClose;

        public bool CanCloseDialog()
        {
            return true;
        }

        public void OnDialogClosed()
        {
            
        }

        public void OnDialogOpened(IDialogParameters parameters)
        {
            
        }

        public DialogViewModel(IRegionManager regionManager)
        {
            ShowSubViewCommand = new DelegateCommand(() =>
            {
                regionManager.RequestNavigate("DialogViewRegion", "SubView");
            });
        }
    }
}
